package cn.wolfcode.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * Author wyy
 * Date 2021/1/14 11:21
 **/
@Getter
public enum  AppointmentEnum {
    //待确认
    CONFIRMED("待确认",0),
    //履行中
    PERFORM("履行中",1),
    //消费中
    CONSUME("消费中",2),
    //归档
    FINISH("归档",3),
    //废弃
    DISCARD("废弃",4);

    private final String name;
    private final Integer value;

    AppointmentEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static String findStatusName(Integer status) {
        AppointmentEnum[] enums = AppointmentEnum.values();
        for (AppointmentEnum anEnum : enums) {
            if(status.equals(anEnum.getValue())){
                return anEnum.getName();
            }
        }
        return null;
    }
}
